﻿// Copyright (c) Inossem. All rights reserved.
// Licensed under the LGPL-3.0 license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DWF.Studio.ScriptEngine
{
    /// <summary>
    /// 线程堵塞接口
    /// </summary>
    internal interface IThreadBlock : IDisposable
    {
        /// <summary>
        /// 堵塞
        /// </summary>
        void Block();

        /// <summary>
        /// 堵塞
        /// </summary>
        /// <param name="timeout"></param>
        /// <returns></returns>
        bool Block(TimeSpan timeout);

        /// <summary>
        /// 堵塞
        /// </summary>
        /// <param name="millisecondsTimeout"></param>
        /// <returns></returns>
        bool Block(int millisecondsTimeout);

        /// <summary>
        /// 继续
        /// </summary>
        void Continue();

        /// <summary>
        /// 重置
        /// </summary>
        void Reset();
    }
}
